<?php
 
 
class PhpFox_Mod_Menu_ComponentMenuList extends BaseComponent
{
	function process()
	{
		$oSrvMenu = &$this->_oModule->getService('Menu');
		
		$oReq = &App::getRequest();
	
		if ( $iId = $oReq->get('delete') )
		{
			$bIsDeleted = $oSrvMenu->_deleteMenu($iId);
		}
		
		if ( $oReq->get('ordering') )
		{
			$aM = $oReq->getArray('listing');
			
			foreach($aM as $iId => $iValue)
			{
				$oSrvMenu->_updateCount($iId, $iValue);
			}
			
			$bUpdatedCount = true;
		}
		
		$this->oTpl->assign(array
		(
			'aMenus' => $oSrvMenu->_getMenus(),
			'bIsDeleted' => (isset($bIsDeleted) ? $bIsDeleted : ''),
			'bUpdatedCount' => (isset($bUpdatedCount) ? true : false),
		));	
	
		return $this->oTpl->fetch('MenuList.html');
	}
}

?>